package com.dataStructure.queue;


import java.math.BigInteger;
import java.util.*;
import java.util.concurrent.LinkedBlockingDeque;

public class Main {
    public static void main(String[] args) {
       
//        long time = 46800999;
//        Date date = new Date(time);
//        System.out.println(date.toString());
//        ZoneId zoneId = ZoneId.systemDefault();
//        LocalDateTime localDateTime = date.toInstant().atZone(zoneId).toLocalDateTime();
//        System.out.println(localDateTime.getHour() + ":" + localDateTime.getMinute() + ":" + localDateTime.getSecond());

        /**
         * 时间差，时间日期格式化
         */
//        LocalDateTime now = LocalDateTime.now();
//        System.out.println(LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli());
//        System.out.println(System.currentTimeMillis());
//        LocalDateTime of = LocalDateTime.of(2013, 12, 1,13,2);
//        Duration between = Duration.between(of, now);

        /**
         * 数组选择指定位置进行排序，Java语言都是from是真实，to指定位置的前一位
         *
         * Arrays 数组切分方法  copyOf()     copyOfRange()
         */
        Integer[] ar = new Integer[5];
        ar[0] = 45;
        ar[1] = 12;

        ar[2] = 13;

        ar[3] = 19;
        ar[4] = 56;
        Integer[] integers = Arrays.copyOf(ar, 3);
        Integer[] integers1 = Arrays.copyOfRange(integers, 0, 2);
        System.out.println(Arrays.toString(integers1));
        //倒叙
        Arrays.sort(ar, 0, 2, (o1, o2) -> o2 - o1);


        String word  = "sfdsd12";

        /**
         * 常见的正则表达式，^(0+) 表示前导0， [a-z]表示小写字母，[0-9]数字，[a-zA-Z]字母，subString也如此，
         *
         * spilt按照指定内容进行分割，如果出现如下字符串 "  df w s   sd”，最后切割的数量不可预判，但是会出现元素为 ""的情况
         *
         */

//        System.out.println(str.length());//        String s = word.replaceAll("[a-z]", " ");
////        String[] s1 = s.split(" ");
////        HashSet<String> set = new HashSet<>();
////        for (String e : s1) {
////            //如果是字符串
////            if(!e.equals("") && !e.equals(" ")) {
////                String s2 = e.replaceAll("^(0+)", "");
////                set.add(s2);
////            }
////        }
//
////        String str = "  s f d    f";
//
//        String[] s = str.split(" ");

        /**
         * 大数运算
         */

//        BigInteger as = new BigInteger("1");
//        BigInteger bigInteger = new BigInteger("1212");
//        BigInteger mod = bigInteger.mod(as);
        Integer a = 23;
        System.out.println(Integer.toBinaryString(a));
        String s = Integer.toString(a, 2);

        LinkedBlockingDeque<Integer> que = new LinkedBlockingDeque<>();
      
    }
}